//
//  BMARadio.m
//  LZMusicPlayer
//
//  Created by wulanzhou on 2016/11/1.
//  Copyright © 2016年 wulanzhou. All rights reserved.
//

#import "BMARadio.h"

@implementation BMARadio

/**
 * 录制电台
 * @param pageNo	页数
 * @param pageSize	每页数量，也是返回数量
 * @return
 */
- (NSString *) recChannel:(int) pageNo pageSize:(int) pageSize{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.radio.getRecChannel"];
    [sb appendFormat:@"&page_no=%d",pageNo];
    [sb appendFormat:@"&page_size=%d",pageSize];
    return sb;
    
}

/**
 * 推荐电台（注意返回的都是乐播节目)
 * @param num
 * @return
 */
- (NSString *) recommendRadioList:(int)num{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.radio.getRecommendRadioList"];
    [sb appendFormat:@"&num=%d",num];
    return sb;
}

/**
 * 频道歌曲
 * @param channelname	频道名,注意返回的json数据频道有num+1个，但是最后一个是空的
 * @return
 */
- (NSString *) channelSong:(NSString*)channelname num:(int)num{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.radio.getChannelSong"];
    [sb appendFormat:@"&channelname=%@",channelname];
    [sb appendString:@"&pn=0"];
    [sb appendFormat:@"&rn=%d",num];
    return sb;
}

@end
